﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using StarPhar.Entity;

namespace StarPhar.Controllers
{
    public class HomeController : Controller
    {
        public ActionResult Index()
        {
            //ViewBag.Message = "Welcome to ASP.NET MVC!";
            //TBCategory cate = new TBCategory();
            //cate.CategoryID = Guid.NewGuid();
            //cate.Code = 2;
            //cate.Name = "Test1";
            //cate.STT = 1;
            //DataServices.DataContext.TBCategories.AddObject(cate);
            //DataServices.DataContext.SaveChanges();
            var list = DataServices.DataContext.TBCategories.Where(a => a.Code == 2).ToList();
            return View(list);
        }

        public ActionResult About()
        {
            return View();
        }
    }
}
